package priv.lirenhe.exam.B;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class Example02 {

	public static void main(String[] args) throws IOException {
		File fileDir = new File("jiwang_test");
		File file = new File("./jiwang_test/file01.txt");
		
		if( !fileDir.exists() ){
			fileDir.mkdir();
			file.createNewFile();
		}else{
			if( !file.exists() ){
				file.createNewFile();
			}
		}
		
		Writer fw = new BufferedWriter(new FileWriter(file));
		String strE = "hello world";
		String strC = "你好";
		
		fw.write(strE);
		fw.write("\r\n");
		fw.write(strC);
		fw.close();
		
	}

}
